import SvgIcon from './SvgIcon/index.vue'
import Pagination from './Pagination/index.vue'
import Category from './Category/index.vue'

import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const allGlobalComponent = {
  SvgIcon,
  Pagination,
  Category,
}

export default {
  install(app: object) {
    // 注册全局组件
    Object.keys(allGlobalComponent).forEach((key) => {
      app.component(key, allGlobalComponent[key])
    })
    // 注册element-plus的图标组件
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component)
    }
  },
}
